home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / fplib20 / fpcmp.s < prev    next >
Text File  |  1990-11-23  |  1KB  |  49 lines

  1. * Copyright (c) 1988 by Sozobon, Limited.  Author: Johann Ruegg
  2. *
  3. * Permission is granted to anyone to use this software for any purpose
  4. * on any computer system, and to redistribute it freely, with the
  5. * following restrictions:
  6. * 1) No charge may be made other than reasonable charges for reproduction.
  7. * 2) Modified versions must be clearly marked as such.
  8. * 3) The authors are not responsible for any harmful consequences
  9. *    of using this software, even if they result from defects in it.
  10. *
  11. * MODIFICATIONS:
  12. *
  13. * D.W.Brooks    3/5/89    Fixed fpcmp (when both -ve) and fpneg (when zero)
  14. *
  15.  
  16.     .globl    fpcmp
  17.     .globl    _fpcmp
  18. fpcmp:
  19. _fpcmp:
  20.     move.l    4(sp),d0
  21.     move.l    8(sp),d1
  22. * Start DWB
  23.     move.b    d0,d2        * See if both signs are negative
  24.     and.b    d1,d2
  25.     bpl    L0
  26.     move.l    d0,d2        * They are: switch arguments so the rest works
  27.     move.l    d1,d0
  28.     move.l    d2,d1
  29. L0:
  30. * End DWB
  31.     cmp.b    d1,d0
  32.     bne    L1
  33.     cmp.l    d1,d0
  34. L1:
  35.     rts
  36.  
  37.     .globl    fpneg
  38.     .globl    _fpneg
  39. fpneg:
  40. _fpneg:
  41.     move.l    4(sp),d0
  42.  
  43. * DWB removed: tst.b    d0 (unnecessary to test for 0.0)
  44.  
  45.     beq    L2
  46.     eor.b    #$80,d0
  47. L2:
  48.     rts
  49.